# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer:  Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=perl-inline
_pkgname=Inline
pkgver=0.86
pkgrel=1
pkgdesc="Write Perl subroutines in other programming languages"
url="https://metacpan.org/pod/distribution/Inline/lib/Inline.pod"
arch="noarch"
license="Artistic-1.0-Perl OR GPL-1.0-or-later"
depends="perl"
checkdepends="perl-test-warn"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/I/IN/INGY/Inline-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

prepare() {
	default_prepare
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

sha512sums="d7f5a15f66c686c89dbc0b6aa3e2496b939683befeb5033b242b4d5281cc1ed6bb5d7303f51059177e042d6fe8c903e4df535099b60eb16dbef431b50a179ac0  Inline-0.86.tar.gz"
